# -*-conding:utf-8-*-

"""

 Created by feiwo at 2018/7/31
 
"""
from app.models.Base import Base
from sqlalchemy import Column, String, Integer, Text, ForeignKey, SmallInteger
from sqlalchemy.orm import relationship

__author__ = 'feiwo'


class Category(Base):
    __tablename__ = 'category'

    cateName = Column(String(128), nullable=False, unique=True, name='cate_name')
    cate = relationship('Category')
    parentId = Column(Integer(), ForeignKey('cate.id'))
    intro = Column(Text())
    coverUrl = Column(String(128), name='cover_url')
    coverUrlAbs = Column(String(255), name='cover_url_abs')
    orderBy = Column(SmallInteger, nullable=False, default=0, name='order_by')
    url = Column(String(255))

